package com.cc.sanjieduan.controller;

import com.cc.sanjieduan.dto.R;
import com.cc.sanjieduan.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/menus")
public class MenuController {

    private MenuService menuService;

    @Autowired
    public void setMenuService(MenuService menuService) {
        this.menuService = menuService;
    }

    @PostMapping("/menu/enable")
    public R updateEnable(String enbale, String menuId) {
        menuService.updateMenuEnable(enbale, menuId);
        return R.setOK();
    }
}
